/**
 * @ClassName Overload
 * @Description 方法重载
 * @Author 李明忠
 * @Date 2025/4/27 21:01
 * @Version 1.0
 */
public class Overload {
    public static void main(String[] args) {
        //参数类型不同
        sum(100,200);
        sum(10.5,2.0);

        //参数顺序不同
        sum(10,10.1);
        sum(10.2,10);

        //参数个数不同
        sum(10,20);
        sum(10,20,30);
    }
    public static int sum(int x,int y){
        return x + y;
    }
    public static double sum(double x,double y){
        return x + y;
    }
    public static double sum(int x,double y){
        return x + y;
    }
    public static double sum(double x,int y){
        return x + y;
    }
    public static int sum(int x,int y,int z){
        return x + y + z;
    }
}
